package com.mukefile.action;

import com.mukefile.pojo.User;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import java.util.Map;

/**
 * @Author: kenewstar
 * @Description:
 * @Date:Created in 2020/5/5
 */
@Controller("pageAction")
@Scope("prototype")
public class PageAction extends ActionSupport{
    //获取session
    private Map session = (Map)ActionContext.getContext().getSession();

    @Override
    public String execute() throws Exception {
        User user = (User)session.get("user");
        if (user==null){
            return LOGIN;
        }
        return SUCCESS;
    }
}
